#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int a[10];
	double y = 0;
	for(int i=0;i<10;i++)
	{
		scanf("%d", &a[i]);
		y = y + a[i];
	}
	for (int i = 8; i >=0; i--)
	{
		for (int j = 0; j <= i; j++)
		{
			if (a[j] > a[j + 1])
			{
				int c;
				c = a[j];
				a[j] = a[j + 1];
				a[j + 1] = c;
			}
		}
	}
	y = y / 10;
	int l = 0, r = 9,mid;
	while (l < r)
	{
		mid = (l + r) / 2;
		if (a[mid] >= y)
			r = mid;
		else
			l = mid + 1;
	}
	l = 9 - l ;
	if (a[r] != y)
	{
		l = l + 1;
	}
	printf("%d", l);
	return 0;
}